.PHONY: all settings hexdump sendserial

all: settings hexdump sendserial send

OBJ_COMM := settty.o
OUT_DIR := out
INCLUDES := -Iinclude
CFLAGS :=  -Wall $(INCLUDES) -g
LIBS :=
LDFLAGS :=

settings:  $(OBJ_COMM) hex.o settings.o
	$(CC) $(CFLAGS) $(LIBS) $(LDFLAGS) $^ -o $(OUT_DIR)/$@

hexdump:  $(OBJ_COMM) hexdump.o settty.o
	$(CC) $(CFLAGS) $(LIBS) $(LDFLAGS) $^ -o $(OUT_DIR)/$@

sendserial: $(OBJ_COMM) sendserial.o
	$(CC) $(CFLAGS) $(LIBS) $(LDFLAGS) $^ -o $(OUT_DIR)/$@

send: $(OBJ_COMM) hex.o settty.o send.o
	$(CC) $(CFLAGS) $(LIBS) $(LDFLAGS) $^ -o $(OUT_DIR)/$@

.PHONY: clean
clean:
	$(RM) -fv *.o $(OUT_DIR)/settings $(OUT_DIR)/hexdump $(OUT_DIR)/sendserial
